package util;

import org.apache.commons.lang3.StringUtils;
import org.hibernate.criterion.Example.PropertySelector;
import org.hibernate.type.Type;

public class CommonPropertySelector implements PropertySelector {

	@Override
	public boolean include(Object object, String arg1, Type arg2) {
		boolean result = true;
		if(object==null)
			result = false;
		else if((object instanceof String) &&
				StringUtils.isBlank((String)object)){
			result = false;
		}
		else if((object instanceof Long) &&
				((Long)object == 0)){
			result = false;
		}
		return result;
	}

}
